package club.calong.sanniu.pojo;

import club.calong.sanniu.pojo.type.IntegerSetConverter;
import club.calong.sanniu.pojo.type.StringListConverter;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.Set;

@TableName("role")
public class Role {
	public static final String ID = "role_id";
	public static final String ROLE_NAME = "role_name";
	public static final String ROLE_PERMISSION = "role_permission";

	@TableId(value = ID, type = IdType.AUTO)
	private Integer id;

	@TableField(ROLE_NAME)
	private String name;

	@TableField("role_desc")
	private String introduction;

	@TableField(value = ROLE_PERMISSION, typeHandler = IntegerSetConverter.class)
	private Set<Integer> permissions;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Set<Integer> getPermissions() {
		return permissions;
	}

	public void setPermissions(Set<Integer> permissions) {
		this.permissions = permissions;
	}

	public String getIntroduction() {
		return introduction;
	}

	public void setIntroduction(String introduction) {
		this.introduction = introduction;
	}
}
